package com.w3c.pragmatic.domain.res;

import com.w3c.pragmatic.entity.ProductInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;

/**
 * 产品信息
 *
 * @author wangdong
 * @since 2025-02-20
 */
@Data
@ApiModel(value = "ProductInfoRes对象", description = "产品信息")
public class ProductInfoRes {

  @ApiModelProperty(value = "产品类型")
  private String productType;

  @ApiModelProperty(value = "产品编码")
  private String productCode;

  @ApiModelProperty(value = "产品名称")
  private String productName;

  @ApiModelProperty(value = "产品数量")
  private Integer productNum;

  public static ProductInfoRes genToRes(ProductInfo productInfo){
    ProductInfoRes productInfoRes = new ProductInfoRes();
    BeanUtils.copyProperties(productInfo, productInfoRes);
    return productInfoRes;
  }
}
